home *** CD-ROM | disk | FTP | other *** search
- /* status.c from page 247*/
- #include <stdio.h>
- #include <stdlib.h>
- main()
- {
- float a;
- double b = 1.e-40;
- unsigned fpstatus;
- printf("Before any computations");
- fpstatus = _status87();
- printf("status word is: %x\n", fpstatus);
- /*perform operation that produces
- * underflow and an inexact result */
- a = b; /*This will produce inexact result */
- printf("After underflow/inexact");
- fpstatus = _status87();
- printf("status word is: %x\n", fpstatus);
- }
-